package com.dzk.cp.c11x5.constant;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;

import com.dzk.cp.util.CpUtils;

public class C11x5Attrs {
	
	private static List<String> allRX2;
	
	private static List<String> allRX3;
	
	private static List<String> allRX4;
	
	private static List<String> allRX5;
	
	private static List<String> allRX6;
	
	private static List<String> allRX7;
	
	private static List<String> allRX8;
	
	private static List<String> allRX9;
	
	private static List<String> allZHX1;
	
	private static List<String> allZHX2;
	
	private static List<String> allZHX3;
	
	private static List<String> allZX2;
	
	private static List<String> allZX3;
	
	static {
		initAllRX2();
		initAllRX3();
		initAllRX4();
		initAllRX5();
		initAllRX6();
		initAllRX7();
		initAllRX8();
		initAllRX9();
		initAllZHX1();
		initAllZHX2();
		initAllZHX3();
		initAllZX2();
		initAllZX3();
	}
	
	private static void initAllRX2() {
		allRX2 = getAllRXn(2);
	}
	
	private static void initAllRX3() {
		allRX3 = getAllRXn(3);
	}
	
	private static void initAllRX4() {
		allRX4 = getAllRXn(4);
	}
	
	private static void initAllRX5() {
		allRX5 = getAllRXn(5);
	}
	
	private static void initAllRX6() {
		allRX6= getAllRXn(6);
	}
	
	private static void initAllRX7() {
		allRX7 = getAllRXn(7);
	}
	
	private static void initAllRX8() {
		allRX8 = getAllRXn(8);
	}
	
	private static void initAllRX9() {
		allRX9 = getAllRXn(9);
	}
	
	private static void initAllZHX1() {
		allZHX1 = getAllZHXn(1);
	}
	
	private static void initAllZHX2() {
		allZHX2 = getAllZHXn(2);
	}
	
	private static void initAllZHX3() {
		allZHX3 = getAllZHXn(3);
	}
	
	private static void initAllZX2() {
		allZX2 = getAllRXn(2);
	}
	
	private static void initAllZX3() {
		allZX3 = getAllRXn(3);
	}
	
	public static List<String> getAllRXn(int n) {
		List<String> allRXn = new ArrayList<String>();
		List<Integer> list = Arrays.asList(new Integer[] {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11});
		List<List<Integer>> resultList = CpUtils.combine(list, n);
		for (List<Integer> elemList : resultList) {
			StringBuilder xn = new StringBuilder();
			for (Integer elem : elemList) {
				xn.append(" ").append(CpUtils.fore2zero(elem));
			}
			allRXn.add(xn.substring(1));
		}
		return allRXn;
	}
	
	public static List<String> getAllZHXn(int n) {
		List<String> allZHXn = new ArrayList<String>();
		List<Integer> list = Arrays.asList(new Integer[] {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11});
		List<List<Integer>> resultList = CpUtils.permute(list, n);
		for (List<Integer> elemList : resultList) {
			StringBuilder xn = new StringBuilder();
			for (Integer elem : elemList) {
				xn.append(" ").append(CpUtils.fore2zero(elem));
			}
			allZHXn.add(xn.substring(1));
		}
		return allZHXn;
	}

	public static List<String> getAllRX2() {
		return allRX2;
	}

	public static List<String> getAllRX3() {
		return allRX3;
	}

	public static List<String> getAllRX4() {
		return allRX4;
	}

	public static List<String> getAllRX5() {
		return allRX5;
	}

	public static List<String> getAllRX6() {
		return allRX6;
	}

	public static List<String> getAllRX7() {
		return allRX7;
	}

	public static List<String> getAllRX8() {
		return allRX8;
	}
	
	public static List<String> getAllRX9() {
		return allRX9;
	}

	public static List<String> getAllZHX1() {
		return allZHX1;
	}

	public static List<String> getAllZHX2() {
		return allZHX2;
	}

	public static List<String> getAllZHX3() {
		return allZHX3;
	}

	public static List<String> getAllZX2() {
		return allZX2;
	}

	public static List<String> getAllZX3() {
		return allZX3;
	}
	
	public static void main(String[] args) {
		System.out.println(allZHX1);
		System.out.println(allZHX2);
		System.out.println(allZHX3);
		System.out.println(allZX2);
		System.out.println(allZX3);
	}

}
